package com.gjh.controller;


import com.gjh.domain.system.User;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class BeanController {
    @Autowired
    protected HttpServletRequest request;
    @Autowired
    protected HttpServletResponse response;
    @Autowired
    protected HttpSession session;

    //获取当前登录人信息
    protected User getUser(){
        return (User) session.getAttribute("loginUser");
    }
    //获取当前登录人所在的企业id
    protected String getCompanyId(){
        if(getUser()!=null){
            return getUser().getCompanyId();
        }
        return null;
    }
    //获取当前登录人的所在企业
    protected String getComanyName(){
        if(getUser()!=null){
            return getUser().getCompanyName();
        }
        return null;
    }
}
